/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package classes;

import com.sun.istack.internal.NotNull;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author andrebattagello
 */
@Entity
@NamedQueries({
    @NamedQuery(name = "Reuniao.findAll", query = "SELECT r FROM Reuniao r"),
    @NamedQuery(name = "Reuniao.findByResponsibleName", query = "SELECT r FROM Reuniao r WHERE r.nomeResponsavel = :name" ),
    @NamedQuery(name = "Reuniao.findByInterval", query= "SELECT r FROM Reuniao r WHERE r.dataInicio >= :start AND r.dataInicio <= :end "),
    @NamedQuery(name = "Reuniao.findByDate", query= "SELECT r FROM Reuniao r WHERE r.dataInicio = :start"),
    @NamedQuery(name = "Reuniao.findByIntervalPessoa", query= "SELECT r FROM Reuniao r WHERE r.dataInicio >= :start AND r.dataInicio <= :end AND r.nomeResponsavel = :pessoa"),
    @NamedQuery(name = "Reuniao.findByIntervalCategoria", query= "SELECT r FROM Reuniao r WHERE r.dataInicio >= :start AND r.dataInicio <= :end AND r.nomeCategoria = :categoria "),
    @NamedQuery(name = "Reuniao.findByIntervalProjeto", query= "SELECT r FROM Reuniao r WHERE r.dataInicio >= :start AND r.dataInicio <= :end AND r.nomeProjeto = :projeto "),
    @NamedQuery(name = "Reuniao.findByIntervalPessoaCategoria", query= "SELECT r FROM Reuniao r WHERE r.dataInicio >= :start AND r.dataInicio <= :end AND r.nomeResponsavel = :pessoa AND r.nomeCategoria = :categoria "),
    @NamedQuery(name = "Reuniao.findByIntervalPessoaProjeto", query= "SELECT r FROM Reuniao r WHERE r.dataInicio >= :start AND r.dataInicio <= :end AND r.nomeResponsavel = :pessoa AND r.nomeProjeto = :projeto "),
    @NamedQuery(name = "Reuniao.findByIntervalCategoriaProjeto", query= "SELECT r FROM Reuniao r WHERE r.dataInicio >= :start AND r.dataInicio <= :end AND r.nomeCategoria = :categoria AND r.nomeProjeto = :projeto "),
    @NamedQuery(name = "Reuniao.findByIntervalPessoaCategoriaProjeto", query= "SELECT r FROM Reuniao r WHERE r.dataInicio >= :start AND r.dataInicio <= :end AND r.nomeResponsavel = :pessoa AND r.nomeCategoria = :categoria AND r.nomeProjeto = :projeto ")
})
public class Reuniao implements Serializable {
    
    @Id
    @GeneratedValue
    private Integer id;
    
    @NotNull @Temporal(TemporalType.DATE) private Date dataInicio;
    @NotNull @Temporal(TemporalType.TIME) private Date horaInicio;
    @NotNull @Temporal(TemporalType.TIME) private Date horaFim;
    @NotNull private String nomeReuniao;
    private String observacoes;
    
    @NotNull private String nomeResponsavel;
    private String nomeCategoria;
    private String nomeProjeto;
    
    
    public String getNomeResponsavel() {
        return nomeResponsavel;
    }

    public void setNomeResponsavel(String nomeResponsavel) {
        this.nomeResponsavel = nomeResponsavel;
    }
    
    public Date getDataInicio() {
        return dataInicio;
    }

    public void setDataInicio(Date dataInicio) {
        this.dataInicio = dataInicio;
    }

    public Date getHoraFim() {
        return horaFim;
    }

    public void setHoraFim(Date horaFim) {
        this.horaFim = horaFim;
    }

    public Date getHoraInicio() {
        return horaInicio;
    }

    public void setHoraInicio(Date horaInicio) {
        this.horaInicio = horaInicio;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getObservacoes() {
        return observacoes;
    }

    public void setObservacoes(String observacoes) {
        this.observacoes = observacoes;
    }
    
    public String getNomeReuniao() {
        return nomeReuniao;
    }

    public void setNomeReuniao(String nomeReuniao) {
        this.nomeReuniao = nomeReuniao;
    }

    public String getNomeCategoria() {
        return nomeCategoria;
    }

    public void setNomeCategoria(String nomeCategoria) {
        this.nomeCategoria = nomeCategoria;
    }

    public String getNomeProjeto() {
        return nomeProjeto;
    }

    public void setNomeProjeto(String nomeProjeto) {
        this.nomeProjeto = nomeProjeto;
    }

    @Override
    public String toString() {
        return "Reuniao{" + "id = " + id + ", dataInicio=" + dataInicio + ", horaInicio = " + horaInicio + ", horaFim = " + horaFim + ", nomeReuniao =" + nomeReuniao + ", observacoes=" + observacoes + ", nomeResponsavel=" + nomeResponsavel + '}';
    }
    
    
}
